package geppetto.main.adaptation;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

public class AdaptationInfo {
	public ArrayList<String[]> sentenceTokenTypes;

	public AdaptationInfo() {
		super();
		this.sentenceTokenTypes = new ArrayList<String[]>();
	}
	
	public void insert(String[] tokenTypes){
		sentenceTokenTypes.add(tokenTypes);
	}
	
	public String[] getSentenceTokenTypes(int sentence){
		return sentenceTokenTypes.get(sentence);
	}
	
	public void loadFromFile(String file) throws IOException{
		try {
			BufferedReader sourceReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
			while(sourceReader.ready()){			
				String line = sourceReader.readLine();
				String[] words = line.split("\\s+");
				insert(words);
			}
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		
	}
}
